﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using FutureApp.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FutureApp.Orders
{
    /// <summary>
    /// 主表
    /// </summary>
    [Table("OrderHead")]
    public class OrderHead : FullAuditedEntity<Guid, User>, IPassivable
    {
        /// <summary>
        /// 属性的最大长度
        /// </summary>
        public const int MaxNameLength = 50;
        /// <summary>
        /// 商品名称
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string GoodName { get; set; }
        /// <summary>
        /// 商品价格
        /// </summary>
        [Required]
        public virtual double GoodPrice { get; set; }
        /// <summary>
        /// 选择分期
        /// </summary>
        [Required]
        public virtual int? Nums { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string SellName { get; set; }
        /// <summary>
        /// 身份证
        /// </summary>
        [Required]
        [StringLength(15)]
        public virtual string SellIdentity { get; set; }
        /// <summary>
        /// 居住地址
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string HomeAddress{ get; set; }
        /// <summary>
        /// 工作单位
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string Company { get; set; }
        /// <summary>
        /// 工作单位地址
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string CompanyAddress { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [Required]
        [StringLength(11)]
        public virtual string SellTelephone { get; set; }
        /// <summary>
        /// 银行卡号
        /// </summary>
        [Required]
        [StringLength(MaxNameLength)]
        public virtual string SellCard { get; set; }
        /// <summary>
        ///订单类型：1审核中，2已通过审核，3未通过审核，4订单作废
        /// </summary>  
       [Required]
        public virtual int? Type { get; set; } = 1;
        /// <summary>
        /// 激活/禁用
        /// </summary>
        [Required]
        public virtual bool IsActive { get; set; } = true;
        /// <summary>
        ///外键
        /// </summary>
        [ForeignKey("HeadId")]
        public virtual ICollection<OrderMain> OrderMain { get; set; }
       
    }
}
